/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package phd.dupenois.changeidentifiers.base.intrinsic;

import phd.dupenois.changeidentifiers.ChangeIdentifier;
import phd.dupenois.changeidentifiers.dotpatterns.DotPattern;
import phd.dupenois.changeidentifiers.footprints.Footprint;
import phd.dupenois.changeidentifiers.utils.PropertiesTool;

/**
 *
 * @author Max
 */
public class Extent extends ChangeIdentifier{

    @Override
    public double calculateChange(Footprint previousFootprint, 
        DotPattern previousChangeCausingDotPattern, 
        DotPattern dotPattern) throws Exception {
        double previous = PropertiesTool.getVarianceFromCentroid(previousChangeCausingDotPattern);
        double current = PropertiesTool.getVarianceFromCentroid(dotPattern);
        double change = Math.abs(current-previous)/previous;
        return change;
    }
    
}
